package com.dsz.usercenter.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.dsz.usercenter.common.BaseResponse;
import com.dsz.usercenter.model.domain.User;
import com.dsz.usercenter.model.vo.UserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author 23826
 * @description 针对表【user(用户)】的数据库操作Service
 * @createDate 2024-01-06 21:41:28
 */
public interface UserService extends IService<User> {
    List<User> getRecommendUsers(int pageSize,int pageNum,HttpServletRequest request);

    int updateUser(User user, HttpServletRequest request);

    List<User> searchUserByTags_Memory(List<String> tagNameList);

    List<User> searchUserByTags_SQL(List<String> tagNameList);

    //用户中心项目
    User getCurrentUser(HttpServletRequest request);

    boolean isAdmin(HttpServletRequest request);

    boolean isAdmin( User user);

    /**
     * 用户注册
     *
     * @param userAccount   用户账号
     * @param userPassword  用户密码
     * @param checkPassword 校验密码
     * @param planetCode    星球编号
     * @return 用户id
     */
    BaseResponse<Long> userRegister(String userAccount, String userPassword, String checkPassword, String planetCode);

    /**
     * 用户登录
     *
     * @param userAccount  用户账户
     * @param userPassword 用户密码
     * @param request      请求
     * @return 脱敏后的用户信息
     */
    BaseResponse<User> userLogin(String userAccount, String userPassword, HttpServletRequest request);

    /**
     * 用户退出登录
     *
     * @param request 请求对象
     * @return int
     */
    BaseResponse userLogout(HttpServletRequest request);

    /**
     * 用户脱敏
     * @param originUser 原用户
     * @return 脱敏后用户
     */
    User getSafetyUser(User originUser);

    List<UserVO> matchUsers(Integer num, User currentUser);
}
